<%@ include file="../includes/taglibs.jsp"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<div class="vendors-menu">

	<ul class="item-container">
		<%
			List<VendorMenuItem> menus = (List<VendorMenuItem>) request
					.getAttribute("vendorsMenu");
			int counter = 0;
		%>
		
		<c:forEach var="vendorMenu" items="${vendorsMenu}">
			<%
				
				String menuCssClass = "main-item";
				if (counter == 0) {
					menuCssClass = menuCssClass + " first-item";
				}

				if ((counter + 1) >= menus.size()) {
					menuCssClass = menuCssClass + " last-item";
				}
			%>
			<c:if test="${vendorMenu.menu.selected}">
				<%
					menuCssClass = menuCssClass + " selected";
				%>
			</c:if>


			<li class="<%=menuCssClass%>" style="${vendorMenu.htmlStyle}"><a class="main-item-link"
				href="${pageContext.request.contextPath}${vendorMenu.menu.URL}">${vendorMenu.menu.name}</a>
				<c:if test="${vendorMenu.hasContent}">
					<div class="vendor-popup-menu">
						<img src="${vendorMenu.vendor.menuImage.link}" />
						<div>${vendorMenu.vendor.text}</div>
					</div>
				</c:if></li>
			<%
				counter++;
			%>
		</c:forEach>
	</ul>
</div>
